<template>
	<ul class="breadcrumb">
		<li v-for="(item, index) in breadcrumb">
			<router-link :to="item.path" v-if="index !== breadcrumb.length - 1">{{ item.name }}</router-link>
			<span v-else>{{ item.name }}</span>
		</li>
    </ul>
</template>

<script>
export default {
  name: 'VBreadcrumb',
  props: {
    breadcrumb: {
      type: Array,
      default: function () {
        return [
          {
            name: this.$t('message.home'),
            path: '/'
          }
        ]
      }
    }
  }
}
</script>

<style scoped>
.breadcrumb {
  overflow: hidden;
}

.breadcrumb li {
  float: left;
  height: 20px;
  line-height: 20px;
  font-size: 14px;
  color: #666;
}

.breadcrumb li:after {
  content: "\003e";
  display: inline-block;
  height: 20px;
  padding: 0 4px;
}

.breadcrumb li:last-child:after {
	display: none;
}

.breadcrumb a {
  color: #666;
}

.breadcrumb span {
  color: #a5a5a5;
}
</style>